﻿using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace YunBox2.Client.Infrastructure
{
    /// <summary>
    /// UserLoginWindow.xaml 的交互逻辑
    /// </summary>
    [Export(typeof(UserLoginWindow))]
    public partial class UserLoginWindow : Window
    {
        public UserLoginWindow()
        {
            InitializeComponent();
        }

        [Import]
        ViewModels.UserLoginViewModel ViewModel
        {
            get
            {
                return (ViewModels.UserLoginViewModel) DataContext;
            }
            set
            {
                DataContext = value;
            }
        }

        private void PasswordBox_PasswordChanged(object sender, RoutedEventArgs e)
        {
            var passwordBox = (PasswordBox) sender;
            ViewModel.Password = passwordBox.Password;
        }

        private void CancelButton_Click(object sender, RoutedEventArgs e)
        {
            DialogResult = false;
        }
    }
}
